package com.njym.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.njym.dao.PlatformBusinessRecMapper;
import com.njym.entity.PlatformBusinessRec;
import com.njym.service.PlatformBusinessRecService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created with IDEA
 * author:张善兵
 * Date:2018/8/23
 * Time:下午2:13
 */

@Service
public class PlatformBusinessRecServiceImpl extends ServiceImpl<PlatformBusinessRecMapper, PlatformBusinessRec> implements PlatformBusinessRecService {

    @Override
    public List<PlatformBusinessRec> getPlatformBusinessAllStatistical(String orgId, String modeId, String cardNo, String terminalId,String outTradeNo, Date start, Date end) {
        return baseMapper.getPlatformBusinessAllStatistical(orgId, modeId, cardNo, terminalId,outTradeNo, start, end);

    }

    @Override
    public PlatformBusinessRec getAbnormalStatistics(String orgId, String modeId, String cardNo, String terminalId,String outTradeNo, Date start, Date end) {
        return baseMapper.getAbnormalStatistics(orgId, modeId, cardNo, terminalId,outTradeNo, start, end);
    }

    @Override
    public PlatformBusinessRec getPlatformBusinessRecByOutTradeNo(String outTradeNo) {
        return baseMapper.getPlatformBusinessRecByOutTradeNo(outTradeNo);
    }

    @Override
    public List<PlatformBusinessRec> getPlatformByOutTradeNo(String outTradeNo) {
        return baseMapper.getPlatformByOutTradeNo(outTradeNo);
    }

    @Override
    public List<PlatformBusinessRec> getPlatformByOutTradeNos(String outTradeNo) {
        return baseMapper.getPlatformByOutTradeNos(outTradeNo);
    }


    @Override
    public Page<PlatformBusinessRec> queryPlatformBusinessRecDetail(
        Page page,
        String orgId,
        Integer recType,
        Integer abnormalFlag,
        String channelId,
        String channelName,
        String modeName,
        String modeId,
        String tradeStatus,
        String cardNo,
        String terminalId,
        String tradeNo,
        String outTradeNo,
        Date start,
        Date end) {
        return page
            .setRecords(baseMapper.queryPlatformBusinessRecDetail(page, orgId,recType, abnormalFlag, channelId, channelName, modeId, modeName, tradeStatus, cardNo, terminalId, tradeNo, outTradeNo, start, end));
    }

    @Override
    public List<PlatformBusinessRec> downPlatformBusinessRecDetail(
        String orgId,
        Integer recType,
        Integer abnormalFlag,
        String channelId,
        String channelName,
        String modeName,
        String modeId,
        String tradeStatus,
        String cardNo,
        String terminalId,
        String tradeNo,
        String outTradeNo,
        Date start,
        Date end) {
        return baseMapper.downPlatformBusinessRecDetail(orgId,recType, abnormalFlag, channelId, channelName, modeId, modeName, tradeStatus, cardNo, terminalId, tradeNo, outTradeNo,start,end);
    }
}
